package cn.yuanqiao.web.controller.archive.wenjianzhengli;

import cn.yuanqiao.activiti.service.RemoteActivitiService;
import cn.yuanqiao.archive.common.util.SplitArchiveList;
import cn.yuanqiao.common.web.controller.BaseController;
import cn.yuanqiao.common.core.domain.AjaxResult;
import com.alibaba.fastjson2.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;


/**
 * @author zjj
 * @date 2023/6/26
 */
@RestController
@RequestMapping("/archive/saveArchive")
public class SaveArchiveController extends BaseController {

    @Resource
    private RemoteActivitiService remoteActivitiService;

    @Autowired
    private SplitArchiveList splitArchiveList;

    /**
     * 发起流程
     * @param archiveMap
     * @return
     */
    @PostMapping("/startProcess")
    public AjaxResult addItem(@RequestBody Map<String,Object> archiveMap){

        remoteActivitiService.startProcessWsArchiveSave(new HashMap<>());
        return toAjax(true);
    }

    /**
     * 保存归档单
     * @param archiveMap
     * @return
     */
    //@PostMapping("/startProcess")
    public AjaxResult saveArchiveSaveFromData(@RequestBody Map<String,Object> archiveMap){

        remoteActivitiService.startProcessWsArchiveSave(new HashMap<>());
        return toAjax(true);
    }


}
